package com.marion.mrpc.client;

import com.marion.mrpc.Peer;
import com.marion.mrpc.codec.Decoder;
import com.marion.mrpc.codec.Encoder;
import com.marion.mrpc.codec.JSONDecoder;
import com.marion.mrpc.codec.JSONEncoder;
import com.marion.mrpc.transport.HttpTransportClient;
import com.marion.mrpc.transport.TransportClient;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

/**
 * 客户端配置类
 * @author marion
 * @date 2021/9/4
 */
@Data
public class RpcClientConfig {

    /**
     *    1. 定义HTTPTransportSelector
     *    2. 定义加解码
     *    3. 定义选择器RandomTransportSelector
     *    4. 连接数
     *    5. 服务servers
     */

    private Class<? extends TransportClient> transportClass = HttpTransportClient.class;

    private Class<? extends Encoder> encoder = JSONEncoder.class;

    private Class<? extends Decoder> decoder = JSONDecoder.class;

    private Class<? extends TransportSelector> transportSelector = RandomTransportSelector.class;

    private int connectCount = 1;

    private List<Peer> servers = Arrays.asList(new Peer("127.0.0.1", 3000));
    
}
